package dao

import (
	"database/sql"
	"errors"
	"week2/model"
)

var RecordNotFound = errors.New("record not found")

//查询一条
func One(user model.User) (model.User, error) {
	err := sql.ErrNoRows
	if errors.Is(err, sql.ErrNoRows) {
		return user, RecordNotFound
	}
	if err != nil {
		return user, nil
	}
	return user, nil
}
